<?php
class GroupsForm extends Zend_Form {
    public function __construct($options = null) 
    {
    	$baseurl 	= new MHDEV_View_Helper_BaseUrl();
    	$translate	= Zend_Registry::get('lang');
    	
        parent::__construct($options);
        
        $this->setName('groups');
        
        // Title
        $title = new Zend_Form_Element_Text('title');
        $title->setLabel($translate->_('form_groups_title'));
        $title->setRequired(true);
        $title->addValidator('NotEmpty');
        $title->setErrorMessages(array(
            0 => $translate->_('form_groups_title_error')
        ));
 		
        // perm
        $permissions = new Zend_Form_Element_Select('perm_uid');
        $permissions->setRegisterInArrayValidator(false);
        $permissions->setLabel($translate->_('form_groups_permission'));
        $permissions->setDescription($translate->_('form_groups_dpermission'));
        $permissions->addMultiOption('0', $translate->_('form_choose'));
        
		// is public
        $is_public = new Zend_Form_Element_Checkbox('is_public');
		$is_public->setLabel($translate->_('form_groups_public'));
		$is_public->setDescription($translate->_('form_groups_dpublic'));
		
        // delete
		$delete = new Zend_Form_Element_Checkbox('is_deleted');
		$delete->setLabel($translate->_('form_groups_delete'));
		$delete->setDescription($translate->_('form_groups_ddelete'));
		
        // Submit
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel($translate->_('form_save'));
        $submit->setOrder(10);

        
        $this->addElements(array($title, $permissions, $is_public, $delete, $submit));
    }
}  
?>